<template>
  <div class="finance-customer">
    <div class="c-query">
      <span>选择日期</span>
      <n-date-picker style="width:450px" type="daterange" clearable />
      <button class="c-query_btn c-query_btn--search">查询</button>
      <button class="c-query_btn c-query_btn--reset">重置</button>
    </div>
    <div class="b-content">
      <div class="c-block c-block__member-consumption">
        <p class="c-block_title">会员消费</p>
        <div class="c-block_content">
          <n-data-table :columns="incomeColumns" :data="incomeDataList" :bordered="false" />
        </div>
      </div>
      <div class="c-block">
        <p class="c-block_title">会员类型</p>
        <div class="c-block_content">
          <axq-pie :data="pieData"></axq-pie>
        </div>
      </div>
      <div class="c-block">
        <p class="c-block_title">会员动态</p>
        <div class="c-block_card">
          <div class="c-left">
            <span class="iconfont "></span>
            新增会员
          </div>
          <div class="c-right">100人</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { reactive } from 'vue'
import axqPie from '@/components/antv/pie/index.vue'

const pieData = [
  { type: '至尊会员', value: 199 },
  { type: '市场股东', value: 25 },
];

const incomeColumns = [
  {
    title: "排名",
    key: "sort"
  },
  {
    title: "会员姓名/电话",
    key: "total"
  },
  {
    title: "购买数量（件）",
    key: "taking"
  },
  {
    title: "消费金额(元)",
    key: "topUp"
  }
]
const incomeDataList = reactive([
  { sort: 1, total: '大飒飒', taking: 1134, topUp: 112322 },
  { sort: 2, total: '小牛', taking: 134, topUp:83122 },
  { sort: 3, total: '小猪', taking: 54, topUp: 23221 },
  { sort: 4, total:'小猫', taking: 34, topUp: 2322 },
  { sort: 5, total:'小猫', taking: 34, topUp: 2322 },
  { sort: 6, total:'小猫', taking: 34, topUp: 2322 },
  { sort: 7, total:'小猫', taking: 34, topUp: 2322 },
  { sort: 8, total:'小猫', taking: 34, topUp: 2322 },
])
</script>

<style lang="less">
.finance-customer {
  padding: 30px;
  box-sizing: border-box;
  .c-query {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    span {
      margin-right: 10px;
      font-size: 26px;
      font-weight: 500;
      color: #2e323d;
    }
    .c-query_btn {
      width: 114px;
      height: 60px;
      font-size: 26px;
      text-align: center;
      line-height: 60px;
      border-radius: 5px;
      &--search {
        margin: 0 20px;
        color: #fff;
        background: #1981f4;
      }
      &--reset {
        color: #4a5060;
        background: #f8f8f8;
        border: 1px solid #aaa;
      }
    }
  }
  .b-content {
    display: grid;
    grid-template-columns: 57% 42%;
    grid-gap: 30px 20px;
    .c-block {
      padding: 20px;
      background: #fff;
      box-shadow: 0px 1px 10px 0px rgba(0, 0, 0, 0.1);
      border-radius: 4px;
      &__member-consumption {
        grid-row-start: 1;
        grid-row-end: 3;
      }
      &_title {
        position: relative;
        padding-left: 20px;
        font-size: 28px;
        font-weight: 500;
        color: #4a5060;
        &::before {
          position: absolute;
          top: 22%;
          left: 0;
          content: "";
          width: 6px;
          height: 24px;
          background: #373b4f;
        }
      }
      &_card {
        display: flex;
        justify-content: space-between;
        align-items: center;
        height: 100px;
        padding:0 20px;
        margin-top: 20px;
        background: #f8f8f8;
        border: 1px solid #e5e5e5;
        border-radius: 4px;
        .c-left {
          font-size: 24px;
          font-weight: 500;
          color: #4A5060;
        }
        .c-right {
          font-size: 30px;
          font-weight: bold;
          color: #2e323d;
        }
      }
    }
  }
}
</style>